import requests
import re
# 访问资产管理系统
# url='http://172.16.22.108:8080/bsams/front/login.do'
# resp=requests.request('get',url,)
# print(resp.status_code)
# 访问豆瓣
# url='https://www.douban.com/'
# headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0'}
# resp=requests.request('get',url,headers=headers)
# print(resp.text)
# print(resp.status_code)
#
# import requests
# 访问百度
url='http://www.baidu.com/s'
headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0'}
data={'wd':'java'}
resp=requests.get(url,data=data,headers=headers)
resp.encoding='utf-8'
# pattern=r'<title>(.*?)</title>'
# title=re.findall(pattern,resp.text)
# print(title)
print(resp.text)

